﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

namespace Chapter07
{
    using Chapter07.View;
    using System.Windows.Threading;
    using System.IO;

    /// <summary>
    /// App.xaml 的交互逻辑
    /// </summary>
    public partial class App : Application
    {
        private string[] commandLine;

        public string[] CommandLine
        {
            get { return commandLine; }
            set { commandLine = value; }
        }

        public App()
        {
            var splash = new SplashScreen("Images/splash.jpg");
            splash.Show(true);
        }


        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            commandLine = e.Args;
        }

        protected override void OnSessionEnding(SessionEndingCancelEventArgs e)
        {
            base.OnSessionEnding(e);
        }

        private void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
        {
            MessageBox.Show("未处理异常 " + e.Exception.GetType().ToString() + " 忽略并继续");
            e.Handled = true;
        }
    }
}
